﻿
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="~/css/table.css" rel="stylesheet" />
    <link href="~/css/cwcalendar.css" rel="stylesheet" />
    <script src="~/javascript/calendar-ch.js"></script>
    <script src="~/javascript/comm/comm.js"></script>
    <script src="~/javascript/comm/list.js"></script>
    <script src="~/javascript/jquery-1.7.2.js"></script>
    <script src="~/javascript/locate.js"></script>
    <script src="~/javascript/select.js"></script>
</head>

<html>
<body>
    <div id="app">
        <form id="form1">
            <input type="hidden" name="utilBean.currPage" id="page" />
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">
                            您正在做的业务是：人力资源--招聘管理--职位发布管理--职位发布变更
                        </font>
                    </td>
                </tr>

            </table>
            当前可变更是职位发布总数：{{rows}}例
            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr>
                    <td width="15%" class="TD_STYLE1">
                        职位名称
                    </td>
                    <td width="20%" class="TD_STYLE1">
                        公司名称
                    </td>
                    <td width="10%" class="TD_STYLE1">
                        招聘人数
                    </td>
                    <td width="20%" class="TD_STYLE1">
                        发布时间
                    </td>
                    <td width="20%" class="TD_STYLE1">
                        截止时间
                    </td>
                    <td width="8%" class="TD_STYLE1">
                        修改
                    </td>
                    <td width="8%" class="TD_STYLE1">
                        删除
                    </td>
                </tr>


                <tr v-for="(item,index) in dt" :key="index">
                    <td class="TD_STYLE2">
                        {{item.major_name}}
                    </td>
                    <td class="TD_STYLE2">
                        {{item.second_kind_name}}
                    </td>
                    <td class="TD_STYLE2">
                        {{item.human_amount}}
                    </td>
                    <td class="TD_STYLE2">
                        {{item.regist_time}}
                    </td>
                    <td class="TD_STYLE2">
                        {{item.deadline}}
                    </td>

                    <td class="TD_STYLE2">
                        <a :href="'/position/position_release_change/'+[item.mre_id]">修改</a>
                    </td>
                    <td class="TD_STYLE2">
                        <a v-on:click="del([item.mre_id])">删除</a>
                    </td>
                </tr>
            </table>
        </form>
        <div align="center" style="font-size: 18px;color: gray">
            &nbsp;&nbsp;总数：
            <font style="color: maroon;font-weight: bold;">{{rows}}</font>
            例
            &nbsp;&nbsp;&nbsp;
            每页显示 <font style="color: maroon;font-weight: bold;">{{pageSize}}</font>
            条
            &nbsp;&nbsp;&nbsp;
            当前第 <font style="color: maroon;font-weight: bold;">{{currentPage}}</font>
            页
            &nbsp;&nbsp;&nbsp;共
            <font style="color: maroon;font-weight: bold;">{{pages}}</font>
            页
            <a style="color: navy;font-weight: bold" v-on:click="first()">首页</a>

            <a style="color: navy;font-weight: bold"
               v-on:click="prev()">上一页</a>

            <a style="color: navy;font-weight: bold"
               v-on:click="next()">下一页</a>

            <a style="color: navy;font-weight: bold"
               v-on:click="last()">末页</a>

            &nbsp;&nbsp;&nbsp;跳到第
            <input id=page type=text value="1" class=input1 size=1>
            页&nbsp;&nbsp;
            <input type="image" v-on:click="tiao()" src="~/images/go.bmp" width=18 height=18 border=0>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            dt: [],
            rows: 0,
            pages: 0,
            currentPage: 1,
            pageSize: 3,
            tpage: 1
        },
        methods: {
            load: function () {
                var t = this;
                $.ajax({
                    url: "position_change_update2?id=" + t.currentPage,
                    type: "post",
                    success: function (msg) {
                        var d = eval(msg);
                        t.dt = d["list"];
                        t.rows = d["rows"];
                        t.pages = d["pages"];
                    }
                });
            }
            , first: function () {
                this.currentPage = 1;
                this.load();
            },
            next: function () {
                if (this.currentPage < this.pages) {
                    this.currentPage = this.currentPage + 1;
                } else {
                    this.currentPage = this.pages;
                }
                this.load();
            },
            prev: function () {
                if (this.currentPage > 1) {
                    this.currentPage = this.currentPage - 1;
                } else {
                    this.currentPage = 1;
                }
                this.load();
            },
            last: function () {
                this.currentPage = this.pages;
                this.load();
            },
            tiao: function () {
                this.currentPage = this.tpage;
                this.load();
            },
            del: function (id) {
                var t = this;
                if (confirm('确定要删除吗？')) {
                    $.ajax({
                        url: "/position/major_release_Delete",
                        type: "DELETE",
                        data: "id=" + id,
                        success: function (msg) {
                            if (msg > 0) {
                                alert('删除成功!');
                                t.load();
                            }
                        }
                    })
                }
            },
        }
        , mounted: function () {
            this.load();
        }
    });
</script>


